﻿@using SCMS.Resources
@{
    ViewBag.Title = Resources_frank.Global_String_ProcurementPlan + " - " + Resources_frank.Global_String_SupplyChainManagementSystem;
    Layout = "~/Views/Shared/_GeneralLayout.cshtml";
}

<div id="procurementPlanMain" class="contentMain">
    <div class="contentHeader">
        <div class="headerText"><h3 class="title-left">@Resources_frank.Global_String_ProcurementPlan</h3></div>
        <div style="font-size: 13px; text-align: left;">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    @if (UserContext.HasPermission(StandardPermissionProvider.ProcurementPlanManage))
                    {
                        <td class="arrowLink">
                            @Ajax.ActionLink(Resources_frank.Global_String_AddNew, "CreatePP", new AjaxOptions
                            {
                                UpdateTargetId = "ppDiv",
                                LoadingElementId = "loading",
                                Url = Url.Action("CreatePP")
                            })
                        </td>
                    }
                    else
                    { 
                        <td>&nbsp;</td>
                    }
                </tr>
                <tr>
                     <td class="arrowLink">
                        @Ajax.ActionLink(Resources_frank.ProcurementPlan_Index_ViewProcurementPlans, "ViewPPList", new AjaxOptions
                        {
                            UpdateTargetId = "ppDiv",
                            LoadingElementId = "loading",
                            Url = Url.Action("ViewPPList"),
                            OnSuccess = "if (document.getElementById('table') != null) {initSorter();sorter.size(20);}"
                        })
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <br />    
    <div id="loading" style="display: none; color: Blue; font-weight: bold;">
        <img src="../../Content/images/loading_indicator.gif" alt="@Resources_frank.Global_String_Processing" />
    </div>
    <div id="ppDiv" style="padding-left: 2px;">
        <!-- Content goes here-->
        @Html.Action("ViewPPList")
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        if (document.getElementById('table') != null) {
            initSorter();
            sorter.size(20);
        }
    });
</script>

